package Demo;

import java.util.*;

public class whileDemo {
    public static void main(String[] args){

        System.out.println(Arrays.toString(Arrays(5,1,100)));

    }

    public static int[] Arrays(int len,int head,int num){
        int[] arr =new int[len];
        int last;
        for (int i=0;i<arr.length;i++){
            arr[i]=(int)(Math.random()*num)+head;
        }
        for (int i=0;i<arr.length;i++){
            for (int j=i+1;j<arr.length;j++){
                if (arr[i]<arr[j]){
                    last=arr[i];
                    arr[i]=arr[j];
                    arr[j]=last;
                }
            }
        }
        return arr;

    }
}
